//获取域名
if(typeof window.location.origin == 'undefined'){//兼容ie
    var baseUrl = window.location.protocol + '//' + location.host;
}else{
    var baseUrl = window.location.origin;
};
function getAPI(ip,erp) {
    return {
        //获取验证码
        getLoginValidCode: ip + '/controller/clientUser/getLoginValidCode',
        //登录
        login: ip + '/controller/clientUser/login',

        //获取车辆列表
        getCarList: erp + '/controller/getCarList',
        //获取车辆列表数量
        getCarNum: erp + '/controller/getCarNum',

        //获取品牌
        getBrandList: erp + '/controller/getBrandList',
        //获取分组品牌
        getGroupBrandList: erp + '/controller/getGroupBrand',
        //快速选车
        selectFastBrandList:erp + '/controller/fastBrand/selectFastBrandList',
        //获取车辆类型
        getModelList: erp + '/controller/getModelList',
        //获取车身类型
        getCarTypeList: erp + '/controller/getCarTypeList',
        //获取车辆行程区间列表
        getCarMileageList: erp + '/controller/carMileage/getCarMileageList',
        //获取车龄区间列表
        getCarAgeList: erp + '/controller/carAge/getCarAgeList',
        //获取车辆价格区间列表
        getPriceList: erp + '/controller/price/getPriceList',
        //获取车系列表
        getSeriesList: erp + '/controller/getSeriesList',
        //车身颜色
        getColorList: erp + '/controller/getColorList',
        //车辆基础信息
        getCarBaseParam: erp + '/controller/carBase/getCarBaseParam',

        //获取省份列表
        getProvinceList: erp + '/controller/area/province',
        //获取城市列表
        getCityList: erp + '/controller/area/city',

        //新增卖车信息
        insertSellCar: ip + '/controller/token/sellCar/insertSellCar',

        // 车辆列表详情
        getCarById: erp + '/controller/getCarById',
        
        // 亮点配置列表
        getCarConfByModelId: erp + '/controller/model/getCarConfByModelId',

        // 猜你喜欢
        gussYouLike: ip + '/controller/clientCar/gussYouLike',

        // 查询车辆配置
        getModelConfById: erp + '/controller/getCarConfById',

        // 查询车辆配置
        getCarConfById: erp + '/controller/getCarConfById',

        // 询问低价
        getRecordIntentionInfo: ip + '/controller/clientUser/getRecordIntentionInfo'
    }
}

//nginx接口测试
if (baseUrl.indexOf('https://client.anpxd.com') >= 0||baseUrl.indexOf('https://mall.anpxd.com') >= 0){
    var $apiAddress = getAPI('','https://erp.anpxd.com');
    var imageUrl = 'https://fdfs.anpxd.com/';//正式图片服务器地址
} else{
    var $apiAddress = getAPI('','http://testerp.anpxd.com');
    var imageUrl = 'http://testfile.anpxd.com:8083/';//测试图片服务器地址
}
